package com.summer.mall.configuration;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/product_images/**").addResourceLocations("classpath:/uploads/product_images/");
        registry.addResourceHandler("/user_images/**").addResourceLocations("classpath:/uploads/user_images/");
        registry.addResourceHandler("/uploads/**").addResourceLocations("classpath:/uploads/");
    }
}
